﻿<%@ Control Language="C#" Inherits="PT.CarList.EditCarList" AutoEventWireup="True"
    CodeBehind="EditCarList.ascx.cs" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<asp:MultiView ID="mvView" runat="server" ActiveViewIndex="0">
    <asp:View ID="viewListCar" runat="server">
        <div>
            <telerik:RadButton ID="btnAdd" runat="server" Text="Thêm mới" OnClick="_btnAdd_Click">
            </telerik:RadButton>
        </div>
        <telerik:RadGrid ID="grdCar" runat="server" AutoGenerateColumns="false" AllowPaging="true"
            AllowSorting="true" PageSize="10" OnNeedDataSource="_grdCar_OnNeedDataSource">
            <MasterTableView DataKeyNames="ItemId" ClientDataKeyNames="ItemId">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <Columns>
                    <telerik:GridBoundColumn DataField="CarName" HeaderText="Tên" DataType="System.String">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CarType" HeaderText="Loại xe" DataType="System.String">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Price" HeaderText="Giá" DataType="System.String">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="ImageURL" HeaderText="Hình ảnh">
                        <ItemTemplate>
                            <asp:Image ID="imgCar" runat="server" ImageUrl='<%# Eval("ImageURL") %>' Width="40px" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Tên">
                        <ItemTemplate>
                            <asp:LinkButton ID="btnEditItem" Text="Sửa" runat="server" CommandArgument='<%# Eval("ItemID") %>'
                                OnClick="_btnEditItem_Click" />
                            <asp:LinkButton ID="btnDelete" Text="Xóa" runat="server" CommandArgument='<%# Eval("ItemID") %>'
                                OnClientClick="return confirm('Bạn có chắc chắn xóa !');" OnClick="_btnDelete_Click" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <PagerStyle Mode="NumericPages" />
            </MasterTableView>
        </telerik:RadGrid>
    </asp:View>
    <asp:View ID="viewDetail" runat="server">
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width: 75px">
                    <dnn:Label ID="lblName" runat="server" ResourceKey="lblName" CssClass="spanTitle">
                    </dnn:Label>
                </td>
                <td>
                    <telerik:RadTextBox ID="txtName" runat="server" Width="120px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                        ValidationGroup="SaveCar" ErrorMessage="*" ForeColor="red"></asp:RequiredFieldValidator>
                </td>
            </tr>
             <tr>
                <td style="width: 75px">
                    <dnn:Label ID="Label1" runat="server" ResourceKey="lblManufacture" CssClass="spanTitle">
                    </dnn:Label>
                </td>
                <td>
                    <telerik:RadTextBox ID="txtManufacture" runat="server" Width="120px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dnn:Label ID="lblCarType" runat="server" ResourceKey="lblCarType" CssClass="spanTitle">
                    </dnn:Label>
                </td>
                <td>
                    <telerik:RadTextBox ID="txtCarType" runat="server" Width="120px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dnn:Label ID="lblPrice" runat="server" ResourceKey="lblPrice" CssClass="spanTitle">
                    </dnn:Label>
                </td>
                <td>
                    <telerik:RadTextBox ID="txtPrice" runat="server" Width="120px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dnn:Label ID="lblImage" runat="server" ResourceKey="lblImage" CssClass="spanTitle">
                    </dnn:Label>
                </td>
                <td>
                    <asp:Image ID="imgCar" runat="server" Width="200px" />
                    <br />
                    <telerik:RadUpload ID="ruUpload" runat="server" MaxFileInputsCount="1">
                    </telerik:RadUpload>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <dnn:Label ID="lblOtherInfo" runat="server" ResourceKey="lblOtherInfo" CssClass="spanTitle">
                    </dnn:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <dnn:TextEditor ID="txtOtherInfo" runat="server" Height="200px" Width="100%" />
                </td>
            </tr>
             <tr>
                <td colspan="2">
                    <dnn:Label ID="Label2" runat="server" ResourceKey="lblMainDetail" CssClass="spanTitle">
                    </dnn:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <dnn:TextEditor ID="txtDetailInfo" runat="server" Height="400px" Width="100%" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <br />
                    <telerik:RadButton ID="btnBack" runat="server" Text="Trở lại" OnClick="_btnBack_Click">
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnSave" runat="server" Text="Lưu" OnClick="_btnSave_Click"
                        ValidationGroup="SaveCar">
                    </telerik:RadButton>
                    <br />
                    <asp:Label ID="lblResult" ForeColor="Red" runat="server" />
                </td>
            </tr>
        </table>
    </asp:View>
</asp:MultiView>